package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args) throws Exception {
        /**
         * 创建spring核心容器ioc*/      //工厂                              //黑暗配置文件
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");

        UserService userService = (UserService)ac.getBean("userService");
        System.out.println("userService = " + userService);
        userService.findAll();




    }}